package edu.nf.project.mappers.employeeAndCustomerInformation.convention;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.nf.project.entitys.entity.employeeAndCustomerInformation.convention.CustomerInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * 顾客信息 Mapper 接口
 */
@Mapper
public interface CustomerInfoMapper extends BaseMapper<CustomerInfo> {
    //更新用户积分
    @Update("update customer_info set point = #{point} where u_id = #{customerId}")
    Boolean updateCouponCustomer(@Param("customerId") Integer customerId,
                                 @Param("point") Integer point);

    /**
     * 修改余额
     * @param
     */
    @Update("update customer_info set surplus = surplus + #{amount} where u_id = #{uId}")
    void updateSurplus(@Param("uId") Integer uId, @Param("amount") BigDecimal amount);
}
